1 <?php include ( "../inc/connect.inc.php" ); ?>
2 <?php
3 ob_start();
4 session_start();

5 if
(!isset($_SESSION['admin_login'])) {
6     header(
"location: login.php");
7     $user =
"";
8 }

9 else
{
10     $user = $_SESSION[
'admin_login'];
11     $result = mysql_query(
"SELECT * FROM admin WHERE id='$user'");
12         $get_user_email = mysql_fetch_assoc($result);
13             $uname_db = $get_user_email[
'firstName'];
14 }
15
16 $search_value =
"";
17
18 ?>
19
20
21 <!doctype html>
22 <html>
23     <head>
24         <title>Welcome to ebuybd online shop</title>
25         <link rel=
"stylesheet" type="text/css" href="../css/style.css">
26     </head>
27     <body
class="home-welcome-text" style="background-image: url(../image/homebackgrndimg2.png);">
28         <div
class="homepageheader">
29             <div
class="signinButton loginButton">
30                 <div
class="uiloginbutton signinButton loginButton" style="margin-right: 40px;">
31                     <?php
32                         
if ($user!="") {
33                             echo
'<a style="text-decoration: none;color: #fff;" href="logout.php">LOG OUT</a>';
34                         }
35                      ?>
36                     
37                 </div>
38                 <div
class="uiloginbutton signinButton loginButton">
39                     <?php
40                         
if ($user!="") {
41                             echo
'<a style="text-decoration: none;color: #fff;" href="login.php">Hi '.$uname_db.'</a>';
42                         }
43                         
else {
44                             echo
'<a style="text-decoration: none;color: #fff;" href="login.php">LOG IN</a>';
45                         }
46                      ?>
47                 </div>
48             </div>
49             <div style=
"float: left; margin: 5px 0px 0px 23px;">
50                 <a href=
"index.php">
51                     <img style=
" height: 75px; width: 130px;" src="../image/ebuybdlogo.png">
52                 </a>
53             </div>
54             <div
class="">
55                 <div id=
"srcheader">
56                     <form id=
"newsearch" method="get" action="http://www.google.com">
57                             <input type=
"text" class="srctextinput" name="q" size="21" maxlength="120" placeholder="Search Here..."><input type="submit" value="search" class="srcbutton" >
58                     </form>
59                 <div
class="srcclear"></div>
60                 </div>
61             </div>
62         </div>
63         <div
class="categolis">
64             <table>
65                 <tr>
66                     <th>
67                         <a href=
"index.php" style="text-decoration: none;color: #fff;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Home</a>
68                     </th>
69                     <th><a href=
"addproduct.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Add Product</a></th>
70                     <th><a href=
"newadmin.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">New Admin</a></th>
71                     <th><a href=
"allproducts.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #24bfae;border-radius: 12px;">All Products</a></th>
72                     <th><a href=
"orders.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Orders</a></th>
73                 </tr>
74             </table>
75         </div>
76         <div>
77             <table
class="rightsidemenu">
78                 <tr style=
"font-weight: bold;" colspan="10" bgcolor="#4DB849">
79                     <th>Id</th>
80                     <th>P Name</th>
81                     <th>Description</th>
82                     <th>Price</th>
83                     <th>Available</th>
84                     <th>Category</th>
85                     <th>Type</th>
86                     <th>Item</th>
87                     <th>P Code</th>
88                     <th>Edit</th>
89                 </tr>
90                 <tr>
91                     <?php include (
"../inc/connect.inc.php");
92                     $query =
"SELECT * FROM products ORDER BY id DESC";
93                     $run = mysql_query($query);
94                     
while ($row=mysql_fetch_assoc($run)) {
95                         $id = $row[
'id'];
96                         $pName = substr($row[
'pName'], 0,50);
97                         $descri = $row[
'description'];
98                         $price = $row[
'price'];
99                         $available = $row[
'available'];
100                         $category = $row[
'category'];
101                         $type = $row[
'type'];
102                         $item = $row[
'item'];
103                         $pCode = $row[
'pCode'];
104                         $picture = $row[
'picture'];
105                     
106                      ?>
107                     <th><?php echo $id; ?></th>
108                     <th><?php echo $pName; ?></th>
109                     <th><?php echo $descri; ?></th>
110                     <th><?php echo $price; ?></th>
111                     <th><?php echo $available; ?></th>
112                     <th><?php echo $category; ?></th>
113                     <th><?php echo $type; ?></th>
114                     <th><?php echo $item; ?></th>
115                     <th><?php echo $pCode; ?></th>
116                     <th><?php echo
'<div class="home-prodlist-img"><a href="editproduct.php?epid='.$id.'">
117                                     <img src=
"../image/product/'.$item.'/'.$picture.'" class="home-prodlist-imgi" style="height: 75px; width: 75px;">
118                                     </a>
119                                 </div>
' ?></th>
120                 </tr>
121                 <?php } ?>
122             </table>
123         </div>
124     </body>
125 </html>


Gõ tìm kiếm nhanh...